const http = require('http');
const port = '3000';
const minimist = require('minimist')

const argues= minimist(process.argv.slice(2),{
    string: ["ip","port","module","consts"]
});
var time_util= require('./utils/time_util.js');
console.log(argues);
if( !argues.ip || !argues.port || !argues.module){
	console.log('usage: node app.js --ip xx --port pp --module xxx(api or pay) --consts xxx(local or com or cn)');
	return;
}

if(!argues.consts)argues.consts='local';
console.log('app start 1111');
const my_module = require(`./modules/${argues.module}`);
console.log('app start 2222');
if(!my_module){
	console.log('usage: node app.js --ip xx --port pp --mode xxx(api or pay)');
	return;
}
console.log('app start 3333');
my_module.start(argues.ip,argues.port,argues.consts);

